<?php
namespace app\common\model\news;

use think\Model;

class News extends Model
{
    protected $name="news";

    public static function getNewsList($type,$page,$limit,$field='*'){
        $res=self::where(["news_is_show"=>1,"news_type"=>$type])->field($field)->order("news_sort desc,id desc")->limit($page-1,$limit)->select();
        return $res;
    }

    public static function getNewsDetail($id,$field='*'){
        $res=self::where("id",$id)->field($field)->find();
        if(!empty($res)) return $res;
        return false;
    }
}